package com.meizhi.toystory.module;

import com.meizhi.toystory.config.JSONResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.security.RolesAllowed;

/**
 * Created by meilein on 17/5/6.
 */
@RestController
public class LoginController {

    @RequestMapping(value = "login")
    public String login(String username, String password){
        return JSONResult.fillResultString(200,"success","login success");
    }

    @RequestMapping(value = "user")
    @RolesAllowed("USER")
    public String user(){
        return JSONResult.fillResultString(200,"user","login user");
    }

    @RequestMapping(value = "admin")
    @RolesAllowed("ADMIN")
    public String admin(){
        return JSONResult.fillResultString(200,"admin","login admin");
    }
}
